<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<script src="manageView/assets/scripts/public.js" type="text/javascript"></script>
<body class="page-header-fixed">
	<!-- BEGIN CONTAINER -->
	<!-- BEGIN CONTENT -->
	<!--表格操作按钮组-->
	<div>
		<a class="btn blue" href="javascript:;" data-target="#userModel"
			data-toggle="modal" ng-click="insertEnterpriseUser();"> <i
			class="fa fa-plus"></i> 新增
		</a>
		<div class="import">
			<a class="btn blue" > <i class="fa fa-sign-in"></i>导入</a> 
			<input 	type="file"  file-model  file-type="csv"  upload-url="/corpUserUpload" file-size="4"/>
		</div>
		<a class="btn blue"  href="manageView/template.zip"   download> <i class="fa fa-sign-out"></i>模板下载</a> 
		
    </div>
	
	<table class="table table-striped table-bordered table-hover"
		id="table_1">
		<thead>
			<tr>
				<th>用户名称</th>
				<th>用户ID</th>
				<th>联系电话</th>
				<th>邮箱</th>
				<th>所属运营商</th>
				<th>回调地址</th>
				<th>透支额度</th>
				<th>是否允许超额使用</th>
				<th>是否启用</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<tr class="odd gradeX"
				ng-repeat="user in corpUserList  track by $index"
				on-loaded="{{$last}}" target-table="table_1">
				<td><span ng-bind="user.name"></span></td>
				<td><span ng-bind="user.userId"></span></td>
				<td><span ng-bind="user.mobileNo"></span></td>
				<td><span ng-bind="user.email"></span></td>
				<td><span
					ng-bind="user.merchantCode | getValueInArgFilter : merchantMap : 'name'"></span></td>
				<td><span	ng-bind="user.notifyUrl"></span></td>
				<td><span ng-bind="user.quota"></span></td>
				<td><span
					ng-bind="user.allowOverQuota  | getValueInStaticFilter : 'allowOverQuotaArray'"></span></td>
				<td><span
					ng-bind="user.isValid | getValueInStaticFilter : 'validArray'""></span></td>
				<td><a class="btn" href="javascript:;" data-target="#userModel"
					data-toggle="modal" ng-click="updateEnterpriseUser(user);"> 修改
				</a></td>
			</tr>
		</tbody>
	</table>

	<div id="userModel" class="modal fade" role="dialog" aria-hidden="true"
		data-backdrop="false">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">×</button>
					<h4 class="modal-title">企业用户新增/修改</h4>
				</div>
				<div class="modal-body form">
					<div class="form-group">
						<div class="row">
							<label class="col-sm-3 control-label text-right">用户名称</label>
							<div class="col-sm-8">
								<div class="input-group">
									<input type="text" class="form-control  bValidate" key="required,maxlength_50"
										ng-model="selectedUser.name" />
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-3 control-label text-right">对应企业</label>
							<div class="col-sm-8">
								<div class="input-group">
									<select id="corpEnterprise" class="form-control  flexselect  bValidate"  key="required"
										ng-options="merchant.merchantCode as merchant.name for merchant in validEnterpriseMap "
										ng-model="selectedUser.enterpriseCode ">
										<option value=""></option>
									</select>
								</div>
							</div>
						</div>
						<div class="row" ng-show="modifyType=='insert'">
							<label class="col-sm-3 control-label text-right">密码</label>
							<div class="col-sm-8">
								<div class="input-group">
									<input type="text" class="form-control "   key="required,range_6-16"   ng-class=" {'bValidate': modifyType=='insert' , '': modifyType=='update' }"
										ng-model="selectedUser.password" />
								</div><font color="red">请牢记密码，登录时使用</font>
							</div>
						</div>
						<div class="row" ng-show="modifyType=='insert'">
							<label class="col-sm-3 control-label text-right">确认密码</label>
							<div class="col-sm-8">
								<div class="input-group">
									<input type="text" class="form-control  "   key="required,range_6-16"   ng-class=" {'bValidate': modifyType=='insert' , '': modifyType=='update' }"
										ng-model="selectedUser.rePassword" />
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-3 control-label text-right">联系电话</label>
							<div class="col-sm-8">
								<div class="input-group">
									<input type="text" class="form-control  bValidate"   key="tel"
										ng-model="selectedUser.mobileNo" />
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-3 control-label text-right">邮箱</label>
							<div class="col-sm-8">
								<div class="input-group">
									<input type="text" class="form-control bValidate"   key="email"
										ng-model="selectedUser.email" />
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-3 control-label text-right">所属运营商</label>
							<div class="col-sm-8">
								<div class="input-group">
									<select id="corpOperator" class="form-control  flexselect  bValidate"  key="required"
										ng-options="merchant.merchantCode as merchant.name for merchant in validMerchantMap "
										ng-model="selectedUser.merchantCode ">
										<option value=""></option>
									</select>
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-3 control-label text-right">回调地址</label>
							<div class="col-sm-8">
								<div class="input-group">
									<input type="text" class="form-control " 
										ng-model="selectedUser.notifyUrl" />
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-3 control-label text-right">透支额度</label>
							<div class="col-sm-8">
								<div class="input-group" >
									<input type="text" class="form-control bValidate" key="decimal"
										ng-model="selectedUser.quota" />
								</div>
							</div>
						</div>

						<div class="row">
							<label class="col-sm-3 control-label text-right">是否允许超额使用</label>
							<div class="col-md-8">
								<div class="radio-list">
									<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
									<input
										ng-model="selectedUser.allowOverQuota" type="radio" value="1"   class="bValidate"  key="required,number"  
										ng-selected="selectedUser.allowOverQuota==1"  name="selectedUser.allowOverQuota"> 是
									</label> 
									<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
									<input
										ng-model="selectedUser.allowOverQuota" type="radio" value="0"
										ng-selected="selectedUser.allowOverQuota==0"  name="selectedUser.allowOverQuota"> 否
									</label>
								</div>
							</div>
						</div>
						<div class="row">
							<label class="col-sm-3 control-label text-right">是否启用</label>
							<div class="col-md-8">
								<div class="radio-list">
									<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px"> <input
										ng-model="selectedUser.isValid" type="radio" value="1"    class="bValidate"  key="required"
										ng-selected="selectedUser.isValid==1" name="selectedUser.isValid"> 启用
									</label> 
									<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
									 <input
										ng-model="selectedUser.isValid" type="radio" value="0"
										ng-selected="selectedUser.isValid==0"  name="selectedUser.isValid"> 停用
									</label>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-danger" data-dismiss="modal">
						<i class="fa fa-times"></i>关闭
					</button>
					<button type="button" class="btn btn-primary"
						ng-click="modifyEnterpriseUser();">
						<i class="fa fa-check"></i>保存
					</button>
				</div>
			</div>
		</div>
	</div>
</body>
<script src="manageView/assets/scripts/public.js" type="text/javascript"></script>
</html>